home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / FireWire 1.1 DDK DR1 / Interfaces / GenericDriverFamily.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-10  |  4.1 KB  |  168 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        GenericDriverFamily.h
  3.  
  4.     Contains:    Definitions and interfaces for Generic Driver family.
  5.  
  6.     Written by:    Erik Staats
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.        <FW3>    10/22/96    ES        Added driverRefNum to GDFDeviceEventData record.
  13.        <FW2>    10/21/96    ES        Filled in contains field.
  14.        <FW1>    10/21/96    ES        first checked in
  15.  
  16. */
  17.  
  18. #ifndef __GENERICDRIVERFAMILY__
  19. #define __GENERICDRIVERFAMILY__
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. #if PRAGMA_IMPORT_SUPPORTED
  26. #pragma import on
  27. #endif
  28.  
  29. #if PRAGMA_ALIGN_SUPPORTED
  30. #pragma options align=mac68k
  31. #endif
  32.  
  33. typedef KernelID                GDFDeviceEventRegistrationID;
  34. typedef KernelID                GDFDeviceID;
  35.  
  36. enum
  37. {
  38.     kInvalidGDFDeviceEventRegistrationID    = 0,
  39.     kInvalidGDFDeviceID            = 0
  40. };
  41.  
  42. enum
  43. {
  44.     kInvalidGDFEvent            = 0,
  45.     kGDFDeviceAddedEvent        = 1,
  46.     kGDFDeviceRemovedEvent        = 2
  47. };
  48.  
  49. typedef OSStatus    (GDFExpertEntryPoint) (void);
  50. typedef GDFExpertEntryPoint        *GDFExpertEntryPointPtr;
  51.  
  52. struct GDFDeviceEventDataStruct
  53. {
  54.     RegEntryID                    deviceRegEntryID;                        // Name Registry ID of device.
  55.     DriverRefNum                driverRefNum;                            // Driver ref num for device.
  56.     OSType                        serviceType;                            // Service type for device.
  57.     UInt32                        deviceEvent;                            // Type of event that occured.
  58.     GDFDeviceID                    gdfDeviceID;                            // GDF device ID of device.
  59.     GDFDeviceEventRegistrationID
  60.                                 gdfDeviceEventRegistrationID;            // Registration ID for this event.
  61.     UInt32                        eventHandlerData;                        // Data for use by handler.
  62. };
  63. typedef struct GDFDeviceEventDataStruct
  64.                                 GDFDeviceEventData,
  65.                                 *GDFDeviceEventDataPtr;
  66.  
  67. typedef OSStatus (GDFDeviceEventHandlerProc) (
  68.     GDFDeviceEventDataPtr        pGDFDeviceEventData);
  69. typedef GDFDeviceEventHandlerProc
  70.                                 *GDFDeviceEventHandlerProcPtr;
  71.  
  72.  
  73. ////////////////////////////////////////////////////////////////////////////////
  74. //
  75. // GDF service descriptor defs.
  76. //
  77.  
  78. enum
  79. {
  80.     kGDFServiceDescriptionSignature    = 'gdfs'
  81. };
  82.  
  83. enum
  84. {
  85.     kInitialGDFServiceDescriptor    = 0
  86. };
  87.  
  88. enum
  89. {
  90.     kGDFServiceIsLoadedUponDiscovery    = (1 << 0)                        // Auto-load GDFService when discovered.//zzz implement this
  91. };
  92.  
  93. typedef UInt32                    GDFServiceDescVersion;
  94. typedef UInt32                    GDFServiceOSRunTimeOptions;
  95.  
  96. struct GDFServiceTypeStruct
  97. {
  98.     OSType                         gdfServiceName;                            // GDFService name.
  99.     NumVersion                     version;                                // GDFService version number.
  100.     OSType                         reserved;                                // Reserved area.
  101. };
  102. typedef struct GDFServiceTypeStruct
  103.                                 GDFServiceType,
  104.                                 *GDFServiceTypePtr;
  105.  
  106. struct GDFServiceOSRunTimeStruct
  107. {
  108.     GDFServiceOSRunTimeOptions     gdfServiceRuntime;                        // Options for OS runtime.
  109.     Str31                         gdfServiceName;                            // GDFService's name to the OS
  110.     UInt32                         gdfServiceDescReserved[8];                // Reserved area
  111. };
  112. typedef struct GDFServiceOSRunTimeStruct
  113.                                 GDFServiceOSRunTime,
  114.                                 *GDFServiceOSRunTimePtr;
  115.  
  116. struct GDFServiceDescriptionStruct
  117. {
  118.     OSType                         gdfServiceDescSignature;                // Signature field of this structure.
  119.     GDFServiceDescVersion         gdfServiceDescVersion;                    // Version of this data structure.
  120.     GDFServiceType                 gdfServiceType;                            // Type of driver.
  121.     GDFServiceOSRunTime         gdfServiceOSRuntime;                    // OS runtime requirements of GDFService.
  122. };
  123. typedef struct GDFServiceDescriptionStruct
  124.                                 GDFServiceDescription,
  125.                                 *GDFServiceDescriptionPtr;
  126.  
  127.  
  128. ////////////////////////////////////////////////////////////////////////////////
  129. //
  130. // Generic driver family services.
  131. //
  132.  
  133. OSStatus    GDFRegisterDeviceEventHandlerProc (
  134.     OSType                        serviceType,
  135.     UInt32                        numEvents,
  136.     UInt32                        *eventTable,
  137.     GDFDeviceEventHandlerProcPtr
  138.                                 gdfDeviceEventHandler,
  139.     UInt32                        eventHandlerData,
  140.     GDFDeviceEventRegistrationID
  141.                                 *pGDFDeviceEventRegistrationID);
  142.  
  143. OSStatus    GDFUnregisterDeviceEventHandler (
  144.     GDFDeviceEventRegistrationID
  145.                                 gdfDeviceEventRegistrationID);
  146.  
  147. OSStatus    GDFRegisterFSSpecExpert (
  148.     FSSpecPtr                    pExpertFSSpec);
  149.  
  150. OSStatus    GDFRegisterFSSpecResourceExpert (
  151.     FSSpecPtr                    pExpertFSSpec,
  152.     ResType                        expertResType,
  153.     short                        expertResID);
  154.  
  155. #if PRAGMA_ALIGN_SUPPORTED
  156. #pragma options align=reset
  157. #endif
  158.  
  159. #if PRAGMA_IMPORT_SUPPORTED
  160. #pragma import off
  161. #endif
  162.  
  163. #ifdef __cplusplus
  164. }
  165. #endif
  166.  
  167. #endif /* __GENERICDRIVERFAMILY__ */
  168.